<!DOCTYPE html>
<html>

<head lang="en">
    <title>找攻略</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="js/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategyComment.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <link rel="stylesheet" href="js/bootstrap/css/bootstrap.min.css">
    <script src="js/bootstrap/js/bootstrap.min.js"></script>
    <script src="js/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="js/common.js"></script>
    <script src="/js/plugins/eleditor/Eleditor.min.js"></script>
    <script src="/js/plugins/eleditor/webuploader.min.js"></script>
    <script src="js/plugins/jquery-form/jquery.form.js"></script>

</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:window.history.go(-1);">
                <span><i class="fa fa-times"></i></span>
            </a>
        </div>
        <div class="col-5"></div>
        <div class="col" style="text-align: right;">
            <i class="fa fa-floppy-o fg-fw" id="save" data-state="1"><span>保存</span></i>
        </div>
    </div>
</div>

<div class="travels form-group">

    <div id="contentEditor">
    </div>
    <hr/>
    <div class="container">
        <form id="detailForm" method="post" action="/daily/comments">
            <input type="hidden" name="daily.id" id="id"/>
            <input type="hidden" name="content" id="content">
        </form>
    </div>
    <hr/>

</div>


</body>

<script>
    $(function () {
        var Edr = new Eleditor({
            el: '#contentEditor',//这里写选择器
            upload: {
                server: '/images',
                formName: 'pic'
            }
        });
        $("#save").click(function () {
            $("#id").val(getParams().id);
            $("#content").val(Edr.getContent());
            if($("#content")){
                $("#detailForm").ajaxSubmit(function (data) {
                    if (data.success){
                        window.parent.location.href="/dailyContent.html?id="+getParams().id;
                    }

                });
            }else {
                $(document).dialog({
                    type: 'notice',
                    infoText: '请填写数据',
                    autoClose: 2500,
                    position: 'bottom'  // center: 居中; bottom: 底部
                });
            }

        });
    })
</script>
</html>